//
//  EncryptorXXTEA.h
//  Etrans
//
//  Created by fhd on 12-5-10.
//  Copyright 2012 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>

#define KEY @"com.qjs.app"

@interface EncryptorXXTEA : NSObject {

}

//srcString：加密字符串，key：密钥
/**
 *  使用XXTEA加密字符串
 *
 *  @param srcString 加密前字符串
 *  @param key       密钥
 *
 *  @return 加密后字符串,注意此字符串是转换后的十六进制字符串
 */
+ (NSString *)XXTEAEncryptStr:(NSString *)srcString key:(NSString *)key;

/**
 *  使用XXTEA解密字符串
 *
 *  @param srcString 解密前字符串，注意此字符串是转换后的十六进制字符串
 *  @param key       密钥
 *
 *  @return 解密后字符串
 */
+ (NSString *)XXTEADEncryptStr:(NSString *)srcString key:(NSString *)key;

+ (NSString*)hexStringForData:(NSData*)data;
+ (NSData*)dataForHexString:(NSString*)hexString;
+ (NSString *)XXTEADEncryptData:(NSData *)srcData key:(NSString *)key;

+ (void)TestXXTEA;

@end
